package sugarbind_input

class LectinController {

    def scaffold = true
	
	def ddllectins = {}
	
	def findLectins = {
//		println("params support : " +params.lectin_Support.id + " " + Agent.get(params.lectin_Support.id))
//
//		def lectinSupport = Lectin_Support.get(params.lectin_Support.id)
//
//		render(template: 'ddlLectins', model:  [lectins : lectinSupport.lectins])
	
		println("params : " +params)
		
		def lectinSupport
		def lectins
		
		try
		{
			lectinSupport = Lectin_Support.get(params.lectin_Support)
		}
		catch(Exception ex)
		{
			println(ex.getMessage())
		}
	
		if(lectinSupport != null)
		{
			lectins = lectinSupport.lectins
		}
		else
		{
			lectins = Lectin.listLectins()
		}
		render(template: 'ddlLectins', model:  [lectins : lectins])
			
	  }
}
